home *** CD-ROM | disk | FTP | other *** search
- /* stdlib.h standard header */
- #ifndef _STDLIB
- #define _STDLIB
- #ifndef _YVALS
- #include <yvals.h>
- #endif
-
- #if __MWERKS__
- #pragma options align=mac68k
- #endif
-
- /* macros */
- #ifndef NULL
- #define NULL _NULL
- #endif
- #define EXIT_FAILURE _EXFAIL
- #define EXIT_SUCCESS 0
- #define MB_CUR_MAX _Mbcurmax
- #define RAND_MAX 32767
- /* type definitions */
- #ifndef _SIZET
- #define _SIZET
- typedef _Sizet size_t;
- #endif
- #ifndef _WCHART
- #define _WCHART
- typedef _Wchart wchar_t;
- #endif
- typedef struct {
- int quot;
- int rem;
- } div_t;
- typedef struct {
- long quot;
- long rem;
- } ldiv_t;
- typedef int _Cmpfun(const void *, const void *);
- /* declarations */
- _EXTERN_C /* low-level functions */
- int atexit(void (*)(void));
- void exit(int);
- #if __MWERKS__
- int _atexit(void (*)(void));
- void _exit(int);
- #endif
- char *getenv(const char *);
- int system(const char *);
- _END_EXTERN_C
- _C_LIB_DECL
- void abort(void);
- int abs(int);
- void *bsearch(const void *, const void *, size_t, size_t,
- _Cmpfun *);
- void *calloc(size_t, size_t);
- div_t div(int, int);
- void free(void *);
- long labs(long);
- ldiv_t ldiv(long, long);
- void *malloc(size_t);
- int mblen(const char *, size_t);
- size_t mbstowcs(wchar_t *, const char *, size_t);
- int mbtowc(wchar_t *, const char *, size_t);
- void qsort(void *, size_t, size_t, _Cmpfun *);
- int rand(void);
- void *realloc(void *, size_t);
- long strtol(const char *, char **, int);
- size_t wcstombs(char *, const wchar_t *, size_t);
- int wctomb(char *, wchar_t);
- double _Stod(const char *, char **, long);
- float _Stof(const char *, char **, long);
- int _Stoflt(const char *, char **, long[], int);
- long double _Stold(const char *, char **, long);
- unsigned long _Stoul(const char *, char **, int);
- extern char _Mbcurmax;
- extern unsigned long _Randseed;
- _END_C_LIB_DECL
- /* inlines, for C++ */
- #ifdef __cplusplus
- inline double atof(const char *_S)
- {return (_Stod(_S, 0, 0)); }
- inline int atoi(const char *_S)
- {return ((int)_Stoul(_S, 0, 10)); }
- inline long atol(const char *_S)
- {return ((long)_Stoul(_S, 0, 10)); }
- inline void srand(unsigned int _Seed)
- {_Randseed = _Seed; }
- inline double strtod(const char *_S, char **_Endptr)
- {return (_Stod(_S, _Endptr, 0)); }
- inline unsigned long strtoul(const char *_S, char ** _Endptr,
- int _Base)
- {return (_Stoul(_S, _Endptr, _Base)); }
- #else
- /* declarations and macro overrides, for C */
- double atof(const char *);
- int atoi(const char *);
- long atol(const char *);
- void srand(unsigned int);
- double strtod(const char *, char **);
- unsigned long strtoul(const char *, char **, int);
- #define atof(s) _Stod(s, 0, 0)
- #define atoi(s) (int)_Stoul(s, 0, 10)
- #define atol(s) (long)_Stoul(s, 0, 10)
- #define srand(seed) (void)(_Randseed = (seed))
- #define strtod(s, endptr) _Stod(s, endptr, 0)
- #define strtoul(s, endptr, base) _Stoul(s, endptr, base)
- #endif /* __cplusplus */
-
- #if __MWERKS__
- #pragma options align=reset
- #endif
-
- #endif /* _STDLIB */
-
- /*
- * Copyright (c) 1994 by P.J. Plauger. ALL RIGHTS RESERVED.
- * Consult your license regarding permissions and restrictions.
- */
-
-